Skip to content

fix: Handle multiple spaces in Raw Data line for BMG MARS parser#1243

Merged
nathan-stender merged 1 commit into
mainfrom
fix-bmg-mars-raw-data-whitespace
Jul 23, 2026
Merged

fix: Handle multiple spaces in Raw Data line for BMG MARS parser#1243
nathan-stender merged 1 commit into
mainfrom
fix-bmg-mars-raw-data-whitespace

Conversation

@nathan-stender

Copy link
Copy Markdown
Collaborator

Summary

BMG PHERAstar CSV exports can write the Raw Data header with more than one space before the filter parenthesis (e.g. Raw Data (450) with two spaces). The parser's regexes required exactly one literal space, so parsing failed with:

AllotropeConversionError: Raw Data line not found in input file.

This relaxes the whitespace to \s+ in the search regex and all four FILTER_FORMATS patterns in bmg_mars_structure.py.

Changes

  • bmg_mars_structure.py: Raw Data \(Raw Data\s+\( in the search regex and all filter format patterns.
  • Added regression test data: PHERAstar output file.CSV (a real double-space export) and its generated expected .json.

Testing

  • All 8 bmg_mars tests pass.
  • hatch run lint (ruff, black, mypy) clean.

🤖 Generated with Claude Code

Some BMG PHERAstar CSV exports write the Raw Data header with more than
one space before the filter parenthesis (e.g. "Raw Data  (450)"). The
regexes required exactly one space, causing "Raw Data line not found in
input file." errors. Relax the whitespace to \s+ in the search regex and
all filter format patterns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nathan-stender
nathan-stender requested review from a team and slopez-b as code owners July 23, 2026 18:06
@nathan-stender
nathan-stender merged commit e705eb6 into main Jul 23, 2026
9 checks passed
@nathan-stender
nathan-stender deleted the fix-bmg-mars-raw-data-whitespace branch July 23, 2026 18:34
nathan-stender added a commit that referenced this pull request Jul 24, 2026
### Fixed

- Support EnVision calculated formulas without a name prefix (#1246)
- Handle dilutions, replicate measurements, and mmol/l unit in Roche
Cedex Bio HT (#1244)
- Handle multiple spaces in Raw Data line for BMG MARS parser (#1243)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants